# coding=utf-8

import smtplib
from email.mime.text import MIMEText
from email.header import Header

sender = 'wuzhiyi51@sina.com'
receiver = 'wuzhiyi51@163.com'
subject = 'python email test'

smtpserver = 'smtp.sina.com'
username = 'wuzhiyi51@sina.com'
password = 'nihao123!'

msg = MIMEText('<html><h1>你好</h1></html>', 'html', 'utf-8')
msg['Subject'] = subject

smtp = smtplib.SMTP()
smtp.connect(smtpserver)
smtp.login(username, password)
smtp.sendmail(sender, receiver, msg.as_string())
smtp.quit()
